home *** CD-ROM | disk | FTP | other *** search
- Path: gryphon.phoenix.net!usenet
- From: brucew@phoenix.net (Bruce Wedding)
- Newsgroups: comp.lang.c
- Subject: Re: HELP: What is wrong ?
- Date: Wed, 17 Jan 1996 07:00:33 GMT
- Organization: BranPaul Systems
- Message-ID: <4di4gr$674@gryphon.phoenix.net>
- References: <4df373$kd3@ns.etri.re.kr>
- NNTP-Posting-Host: dial73.phoenix.net
- X-Newsreader: Moe's Newsreader
-
- jinsoo@etri.re.kr (Jin-Soo Lee) wrote:
-
- >#define DSKPAGESIZE 16*1024
- >#define LOGBUFSIZE 2*DSKPAGESIZE
-
- You need to wrap these in parentheses. They are expanding and then
- the order of evaluation is getting hosed.
-
- (1) pageBS = (logoffset/LOGBUFSIZE) * LOGBUFSIZE;
-
- expands to (logoffset / 2 * 16 * 1024) * 2 * 16 * 1024
-
- logoffset is divided by 2 then multiplied by 16 then 1024
-
- >(2) bufferoffset = (logoffset + length)%LOGBUFSIZE;
- this becomes (logoffset+length) % 2 * 16 * 1024
- The modulus is done with the 2, not (2*16*1024)
-
- etc etc.
-
-
- Bruce D. Wedding Have Compiler, Will Travel!
- Perspicacious Programming Performed Promptly
- Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
-
-